garmin_fit: bugfix in switch logic
authorMarco Leogrande <dark.knight.ita@gmail.com>
Thu, 22 Jun 2017 05:35:03 +0000 (22:35 -0700)
committerMarco Leogrande <dark.knight.ita@gmail.com>
Sat, 24 Jun 2017 22:14:28 +0000 (15:14 -0700)
The logic for global ID 19 was incorrectly nested under the logic for
global ID 20. Fix the issue by making the two case labels correct
siblings in the same switch statement.

garmin_fit.cc

index 65e9878bc3d5efec3c28aef6ee91bf1ce38ee10d..9d7db66f0c30e42c2cc5fab4aeb652c69641145f 100644 (file)
@@ -411,6 +411,15 @@ fit_parse_data(fit_message_def* def, int time_offset)
           }
           temperature = val;
           break;
+        default:
+          if (global_opts.debug_level >= 1) {
+            debug_print(1, "%s: unrecognized data type in GARMIN FIT record: f->id=%d\n", MYNAME, f->id);
+          }
+          break;
+        } // switch (f->id)
+        // end of case def->global_id = 20
+        break;
+
       case 19: // lap wptType , endlat+lon is wpt
         switch (f->id) {
         case 2:
@@ -461,14 +470,15 @@ fit_parse_data(fit_message_def* def, int time_offset)
           }
           break;
         } // switch (f->id)
+        // end of case def->global_id = 19
         break;
-        default:
-          if (global_opts.debug_level >= 1) {
-            debug_print(1, "%s: unrecognized data type in GARMIN FIT record: f->id=%d\n", MYNAME, f->id);
-          }
-          break;
+
+      default:
+        if (global_opts.debug_level >= 1) {
+          debug_print(1, "%s: unrecognized/unhandled global ID for GARMIN FIT: %d\n", MYNAME, def->global_id);
         }
-      }
+        break;
+      } // switch (def->global_id)
     }
   }